#include "tcpblock.h"

QDataStream& operator>>(QDataStream &in, TcpBlock &block)
{
    in  >> block.blockSize
        >> block.magicNumber
        >> block.type
        >> block.dataBlock;
    return in;
}

QDataStream& operator<<(QDataStream &out, TcpBlock &block)
{
    out << block.blockSize
        << block.magicNumber
        << block.type
        << block.dataBlock;

    return out;
}

QDebug operator<<(QDebug debug, const TcpBlock &block)
{
    debug << Qt::endl
          << "[blockSize]: "   << block.blockSize << Qt::endl
          << "[magicNumber]: " << block.magicNumber << Qt::endl
          << "[BlockType]: "   << block.type << Qt::endl;

    return debug;
}

